Skip to content

Conversation

@hojooo
Copy link

@hojooo hojooo commented Sep 21, 2025

Summary

This PR fixes Docker platform handling issues that occur when building images for a platform different from the host platform. The changes ensure that platform information is properly propagated throughout the buildpack layer export and multi-architecture image inspection processes.

Related Issues

Root Cause

The issues stemmed from incomplete platform information propagation in the Docker API implementation:

  • During buildpack layer export, platform information wasn't passed to the docker save command
  • Multi-architecture image inspection didn't properly respect the pulled digest, leading to platform conflicts

Changes Made

Inspect path improvements

  • After pull, either pin to the resolved manifest digest, or inspect by tag + optional platform to remove ambiguity between index digest and per-arch manifest.

Unified platform parameter encoding

  • For v1.48+/v1.49+ endpoints: pass OCI Platform JSON, e.g., {"os":"linux","architecture":"amd64","variant":"v8"}.

Image.Descriptor parsing

  • Parse Descriptor.digest (and use RepoDigests as a fallback) to reliably resolve and pin the correct per-arch manifest.

Ensure the builder propagates the requested image platform to
DockerApi.exportLayers so Docker 1.41+ saves layers for the pulled
architecture rather than the host default. Add platform-aware tests
issue: spring-projects#46665

Signed-off-by: hojooo <ghwn5833@gmail.com>
Capture the digest emitted during the pull stream and
inspect name@digest so the newly pulled manifest is always used.
issue: spring-projects#46674.

Signed-off-by: hojooo <ghwn5833@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 21, 2025
@hojooo
Copy link
Author

hojooo commented Oct 27, 2025

#46674 (comment)

Signed-off-by: hojooo <ghwn5833@gmail.com>
@hojooo hojooo force-pushed the fix-build-docker-image branch from 66ac80d to 174fdb3 Compare October 28, 2025 07:36
Signed-off-by: hojooo <ghwn5833@gmail.com>
Signed-off-by: hojooo <ghwn5833@gmail.com>
@hojooo hojooo force-pushed the fix-build-docker-image branch 3 times, most recently from 2a15da3 to 8d5a456 Compare November 4, 2025 13:33
Signed-off-by: hojooo <ghwn5833@gmail.com>
@hojooo hojooo force-pushed the fix-build-docker-image branch from 8d5a456 to 772add5 Compare November 4, 2025 16:02
Signed-off-by: hojooo <ghwn5833@gmail.com>
Signed-off-by: hojooo <ghwn5833@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants